package com.sdkj.service.admin.impl;

import java.sql.SQLException;
import java.util.HashMap;
import java.util.Map;

import org.hibernate.HibernateException;
import org.springframework.stereotype.Service;

import com.sdkj.Entity.admin.AdminUser;
import com.sdkj.service.admin.IAdminUserService;
import com.sdkj.service.base.impl.BaseService;

@Service
public class AdminUserServiceImpl extends BaseService<AdminUser> implements IAdminUserService {

	
	@Override
	public AdminUser login(String account, String pwd) {
		String hql="FROM AdminUser where account=:acc and pwd=:pwd";
		Map<String, Object>params=new HashMap<String,Object>();
		params.put("acc", account);
		params.put("pwd", pwd);
		try {
			return super.findByHql(hql, params);
		} catch (HibernateException e) {
			e.printStackTrace();
		} catch (SQLException e) {
			e.printStackTrace();
		}
		return null;
	}
	
}
